Course 5 - Private & Public Key Encryption
Private key algorithms, also known as symmetric algorithms, use the same key for encryption and decryption. Although it is faster and takes up less storage to save only one key, it is less secure. This key is also known as a private key and it known between the parties of communication. If an attacker were to get a hold of the key, entire systems using a symmetric algorithm could be at risk.
The Caesar Cipher got its name from being created around the time of Caesar. It is one of the earliest forms of encryption and was used by Caesar to send messages to his military. It is also quite basic, here is how it works:
Just from this information, you might be able to see how this cipher works. The key, which is an integer, represents how many letters in the alphabet the original message should be shifted by.
Public key algorithms are also called asymmetric algorithms, they use one key for encryption and a different key for decryption. Each party in an asymmetric algorithm has a public key and a private key. Public key algorithms take up more space and are slower, but they are definitely more secure. They are developed using some complex math… we will go over an example of how one of the algorithms work, but for a start, here is a general example.
To remember this, you can use the analogy of a mailbox. Messages are sent and encrypted using the recipient’s public key, similar to how you can put mail in a recipient’s mailbox, which is available to everyone. Messages are decrypted using the recipient’s own private key, similar to how the recipient is the only one that has the key to their own mailbox. When the mail is in the mailbox, it is equivalent to a message being in the state of encryption.
*Video Credit: Simply Explained on Youtube
RSA Algorithm (Example):
If you have been wondering how the use of more than one key can result in the same message, this RSA may help you understand more. This example will use small numbers for simplicity. But in the real world, RSA relies on incredibly large prime numbers and the fact that they are difficult to compute, even for computers.
That was definitely a lot, but we successfully used a public key to encrypt and a private key to decrypt, and we got the same message! This example used a lot of smaller numbers for the sake of simplicity, so there were a lot of repeating numbers. The point is, the math checks out so that even when you use a different key to decrypt, you will end up with the same plaintext. Feel free to try this with larger numbers, and you will get more realistic examples of how this works. There are also plenty of resources online that can explain the algorithm, walkthroughs and calculators for RSA, and other information on this and other ciphers! Additionally, understanding the process and the underlying principles is crucial for mastering RSA.